// let p1 = { name:'国强', age:18, sex: 'boy'}



function User(name, age, career, work) {
    this.name = name
    this.age = age
    this.career = career
    this.work = work
}

// let p2 = new User('国强', 18, 'boy', '前端程序员')

// 构造器就是将 name，age，sex，career赋值给对象的过程封装，
// 确保每个对象都具备这些属性，确保了 共性 不变，个性灵活

function Coder(name, age) {
    this.name = name
    this.age = age
    this.sex = sex
    this.career = 'coder'
    this.work = ['写代码', '喝茶', '摸鱼']
}

function ProductManager(name, age) {
    this.name = name
    this.age = age
    this.career = 'product manager'
    this.work = ['定会议室', '写PRD', '催更']
}

function Factory(name, age, career) {
    switch(career) {
        case'coder':
        work =  ['写代码', '喝茶', '摸鱼']
        break;
        case'Product manager':
        work = ['定会议室', '写PRD', '催更']
        break;
        case 'boss':
        work = ['接电话', '打电话', '见客户']
    }
} 

return new User(name, age, career, work)


